<? $urlOptions = array ('module' => 'admin', 'controller' => 'guild', 'action' => 'add'); ?>
<form id="guild" action="<?= $this->url($urlOptions) ?>" onSubmit="return saveRow(this)" method="post">
<table id="guildList" class="toonStatList" cellspacing="0" cellpadding="3">
   <thead>
      <tr>
	      <th>Guild Name</th>
	      <th>Server Name</th>
	      <th width="20px"></th>
      </tr>
   </thead>
   <tbody>
      <tr>
         <td valign="middle"><?= $this->formText('guild_name', 'Guild Name', array('size' => 20, 'onfocus' => "check_focus(this, 'Guild Name')", 'onblur' => "check_blur(this, 'Guild Name')")); ?></td>
         <td valign="middle"><?= $this->formText('guild_server', 'Server Name', array('size' => 20, 'onfocus' => "check_focus(this, 'Server Name')", 'onblur' => "check_blur(this, 'Server Name')")); ?></td>
         <td width="20px"><?= $this->formSubmit('submit', '+'); ?></td>
      </tr>
<? $i = 0;
$optionsCopy = $urlOptions; 
$optionsCopy['controller'] = 'confirm';
$optionsCopy['action'] = 'deleterow';
$optionsCopy['c'] = 'guild';
foreach ( $this->guilds as $row ):  
      $optionsCopy['i'] = $row['id'] ?>
      <tr id="guild_<?= $row['id'] ?>" class="<?= $i++ % 2 ? 'even' : 'odd' ?>">
         <td valign="middle"><?= $row['name'] ?></td>
         <td valign="middle"><?= $row['server_name'] ?></td>
         <td style="text-align: center">
            <a href="<?= $this->url($optionsCopy)?>" onClick="return deleteRow('guild','<?=$row['id']?>');"><img 
               id="guild_<?=$row['id']?>_img" src="/tools/images/delete_16.png" border="0" height="16" width="16" /></a>
         </td>
      </tr>
<? endforeach; ?>
   </tbody>
</table>
</form>
